package com.example.module_maintenance

import android.annotation.SuppressLint
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.bw.lib_base.path.RouterPath
import com.bw.lib_base.view.BaseActivity
import com.example.module_maintenance.databinding.ActivityMonthVipBinding
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
@Route(path = RouterPath.PATH_MONTH_VIP_ACTIVITY)
class MonthVipActivity : BaseActivity<ActivityMonthVipBinding>() {

    private var selectedVipType : Int = 0

    override fun initView() {
        // 返回按钮点击事件
        mDataBinding.myVipBack.setOnClickListener {
            finish()
        }

        // 会员类型点击事件
        mDataBinding.myVipTypeGold.setOnClickListener {
            selectedVipType = 0;
            setViewShow()
        }
        // 会员类型点击事件
        mDataBinding.myVipTypePlatinum.setOnClickListener {
            selectedVipType = 1;
            setViewShow()
        }
        // 会员类型点击事件
        mDataBinding.myVipTypeDiamond.setOnClickListener {
            selectedVipType = 2;
            setViewShow()
        }

        // 升级按钮点击事件
        mDataBinding.myVipStatusUpgrade.setOnClickListener {

        }
    }

    @SuppressLint("ResourceAsColor")
    private fun setViewShow() {
        when (selectedVipType) {
            0 -> {
                mDataBinding.myVipTypeGold.setBackgroundResource(R.drawable.shape_ffb800_corners4)
                mDataBinding.myVipTypePlatinum.setBackgroundResource(R.drawable.shape_f3f4f6_corners4)
                mDataBinding.myVipTypeDiamond.setBackgroundResource(R.drawable.shape_f3f4f6_corners4)
                mDataBinding.myVipTypeGold.setTextColor(R.color.color_ffffff)
                mDataBinding.myVipTypePlatinum.setTextColor(R.color.color_4b5563)
                mDataBinding.myVipTypeDiamond.setTextColor(R.color.color_4b5563)
            }
            1 -> {
            }
            2 -> {
            }
            else -> {
                selectedVipType = 0
            }
        }
    }

    override fun getLayoutId(): Int  = R.layout.activity_month_vip
        

}